<div class="container">
    <div class="row">
        <div class="span12">
            <?php if (validation_errors() != '') { ?>
                <div class="alert alert-block alert-error">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4 class="alert-heading">Gagal!</h4>
                    <?php echo validation_errors(); ?>
                </div>
            <?php } ?>
        </div>
    </div>
    <h1>Soal <?php echo $materi; ?></h1>
    <hr/>
    <div class="row">
        <div class="buatsoal span12">

            <?php echo form_open('guru/soalsubmit'); ?>
            <div class="control-group">
                <?php echo form_hidden('id',$id); ?>
                <label class="control-label" for="kelas">Kelas </label>
                <div class="controls">
                    <input type="text" name="kelas" id="kelas" value="<?php echo $kelas; ?>" />
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="materi">Materi</label>
                <div class="controls">
                    <input type="text" name="materi" id="materi" value="<?php echo $materi; ?>"/>
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="type_soal">Type Soal</label>
                <div class="controls">
                    <select name="type_soal">
                        <option value="">Type Soal</option>
                        <?php
                        foreach ($query1 as $row1) {
                            if ($id_type_soal == $row1->id) {
                                echo "<option value='" . $row1->id . "' selected>" . $row1->type_soal . "</option>";
                            } else {
                                echo "<option value='" . $row1->id . "'>" . $row1->type_soal . "</option>";
                            }
                        }
                        ?>
                    </select> 
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="jml_soal">Jumlah Soal</label>
                <div class="controls">
                    <input type="text" name="jml_soal" id="jml_soal" value="<?php echo $jumlah_soal; ?> "/>
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="jml_opsi">Jumlah Opsi</label>
                <div class="controls">
                    <select name="jml_opsi">
                        <option value="">Jumlah Soal</option>
                        <?php
                        for ($i = 3; $i < 6; $i++) {
                            if ($i == $jumlah_opsi) {
                                echo "<option value='" . $i . "' selected>" . $i . "</option>";
                            } else {
                                echo "<option value='" . $i . "'>" . $i . "</option>";
                            }
                        }
                        ?>
                    </select>
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="mode_acak">Mode</label>
                <div class="controls">
<?php
if ($mode_acak == 1) {
    ?>
                        <label class="radio">
                            <input type="radio" name="mode_acak" id="optionsRadios1" value="1" checked>
                            acak
                        </label>
                        <label class="radio">
                            <input type="radio" name="mode_acak" id="optionsRadios2" value="0">
                            berurutan
                        </label>
    <?php
}
else {
?>
   <label class="radio">
                            <input type="radio" name="mode_acak" id="optionsRadios1" value="1" >
                            acak
                        </label>
                        <label class="radio">
                            <input type="radio" name="mode_acak" id="optionsRadios2" value="0" checked>
                            berurutan
                        </label>                 
                    <?php
}
                    ?>
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="waktu">Waktu</label>
                <div class="controls">
                    <input type="text" name="waktu" id="waktu" value="<?php echo $waktu; ?>"  />
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <div class="controls">
                    <input type="submit" name="submit" class="btn btn-primary" value="Save">
                </div>
            </div>
<?php echo form_close() ?>
        </div>
    </div>
</div>
<script type="text/javascript">
    function alertz (type, heading, message) {
        $("#alert-area").append($("<div class='alert-message alert alert-block " + type + " fade in' data-alert><a class='close' data-dismiss='alert' href='#'>&times;</a><h4 class='alert-heading'>"+ heading +"</h4><p> " + message + " </p></div>"));
        $(".alert-message").delay(1000).fadeOut("slow", function () { $(this).remove(); });
    }
</script>
